<template>
    <div>
        <el-row>
      <el-col :span="24" style="text-align: right;">
        <el-input v-model="input" placeholder="请输入查询姓名" style="width: 200px; margin-right: 10px;" clearable ></el-input>
        <el-button type="primary" @click="chaxun()" style="margin-bottom: 10px;">查询</el-button>
      </el-col>
    </el-row>
        <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="mscid" label="就诊信息编号" width="180"></el-table-column>
            <el-table-column prop="pname" label="病人姓名" width="180"></el-table-column>
            <el-table-column prop="identify" label="病人身份证" width="200"></el-table-column>
            <el-table-column prop="sympotm" label="症状" width="180"></el-table-column>
            <el-table-column prop="project" label="方案" width="180"></el-table-column>
            <el-table-column prop="kname" label="科室名" width="180"></el-table-column>
            <el-table-column prop="date" label="时间" width="200"></el-table-column>
        </el-table>
    </div>
</template>

<script>
import axios from 'axios';
export default {
    data() {
        return {
            input: '',
            tableData: []
        };

    },
    methods: {
        chaxun(input) {
            this.$axios.get("/medsci/findByName?input=" + this.input)
                .then((result) => {
                    let data = result.data;
                    if (data.code == 200) {
                        this.tableData = data.data;
                    }
                }).catch((err) => {
                    console.log(err);
                });

        },
        list() {
            axios.get('medsci/findAll')
                .then((result) => {
                    let data = result.data;
                    if (data.code == 200) {
                        this.tableData = data.data;
                    }
                }).catch((error) => {
                    console.error(error);
                });

        }
    },
    mounted() {
        this.list();
    },
};
</script>

<style scoped></style>